{extend name='user/public/layout' /}
{block name='content'}
<div class="overflow_h">
    <div class="screen">
        <div class="screen_box01 overflow_h">
            <ul>
                <li><a href="{:url('user.article/index')}" class="on">文章列表</a></li>
                <li><a href="{:url('user.article/add')}">添加文章</a></li>
            </ul>
        </div>
    </div>
    <div class="user-nav">
        <form id="info_form" action="{:url('user.article/editDo')}" method="post" enctype="multipart/form-data">
            <div class="con_div">
                <ul class="formList width2 list_ul list_mp clearfix">
                    <li>
                        <label>文章标题：</label>
                        <input type="text"  name="title" value="{$info.title}" id="J_title" class="inputStyle width3">
                    </li>
                    <li>
                        <label>所属分类：</label>
                        <select name="cate_id" class="selectStyle">
                            {volist name="articleCate['tree']" id='vo'}
                            <option value="{$vo.id}" {if condition="$vo.id eq $info.cate_id"}selected{/if}>{$vo.name}</option>
                            {present name='vo["_child"]'}
                            {volist name='vo["_child"]' id='val'}
                            <option value="{$val.id}" {if condition="$val.id eq $info.cate_id"}selected{/if}>--{$val.name}</option>
                            {/volist}
                            {/present}
                            {/volist}
                        </select>
                    </li>
                    <li>
                        <label>所属城市：</label>
                        <select name="city" id="city" class="selectStyle">
                            {volist name=":cache('city')['tree']" id='vo'}
                            <option value="{$vo.id}" {if condition="$vo.id eq $info.city"}selected{/if}>{$vo.name}</option>
                            {/volist}
                        </select>

                    </li>
                    <li>
                        <label>来源：</label>
                        <input type="text" class="inputStyle width2" value="{$info.comefrom}" name="comefrom" maxlength="10">
                        <span class="tip">2-10个中文字符（可不填）</span>
                    </li>
                    <li style="height:auto;">

                        <label>缩例图：</label><input type="file" name="img">
                        {notempty name='info.img'}

                        <p style="padding-left:90px;"><img src="{$info.img}" alt="" width="100"></p>

                        {/notempty}
                    </li>
                    <li class="height1"><label>摘要简介：</label><textarea class="textarea" name="description">{$info.description}</textarea></li>
                    <li>
                        <label>文章状态：</label>
                        {if condition='$info.status eq  1 or $info.status eq 3'}
                        <input type="radio" name="status" id="status_1" value="1" {if condition="$info.status eq 1"}checked{/if} />发布
                        <input type="radio" name="status" id="status_0" value="3" {if condition="$info.jishou eq 3"}checked{/if}/>草稿
                        {else /}
                        {:optionStatus($info['status'])}
                        {/if}
                    </li>
                    <li style="margin-bottom: 5px;"><label>详细内容：</label><label style="width: 400px;"><input type="checkbox" name="thumb" value="1"> 使用内容第一张图片做为缩例图</label></li>
                    <li class="height2">
                        <textarea name="info" id="info" style="width:850px;height:500px;resize: none;float:left">{$info.info}</textarea>
                    </li>
                    <input type="hidden" name="id" value="{$info.id}">
                    <li class="clearfix" style="padding-top:10px;">
                        <label></label>
                        <input type="submit" value="提 交" class="btnStyle" onclick="window.scroll(0,0);">
                    </li>
                </ul>
            </div>
        </form>
    </div>
</div>
<script src="__PUBLIC__/js/ueditor/ueditor.config.js"></script>
<script src="__PUBLIC__/js/ueditor/ueditor.all.min.js"></script>
<script src="__PUBLIC__/js/ueditor/lang/zh-cn/zh-cn.js"></script>
<script src="__PUBLIC__/js/plugins/formvalidator.js"></script>
<script type="text/javascript">
    window.UEDITOR_HOME_URL='__PUBLIC__/js/ueditor/';
    window.onload=function(){
        window.UEDITOR_CONFIG.initialFrameWidth=880;
        window.UEDITOR_CONFIG.initialFrameHeight=500;
        window.UEDITOR_CONFIG.autoHeightEnabled = false;
        var ue = UE.getEditor('info', {
            toolbars: [[
                'fullscreen', 'source', '|',
                'bold', 'italic', 'underline', '|', 'fontfamily','fontsize', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', 'insertimage','|', 'kityformula', 'preview'
            ]]
        });
    };
    $(function(){
        $.formValidator.initConfig({formid:"info_form",autotip:true});
        $("#J_title").formValidator({onshow:"请填写文章标题",onfocus:"请填写文章标题"}).inputValidator({min:1,onerror:"请填写文章标题"});

    });

</script>
{/block}